package hsp.admin.app.literature.controller;

import hsp.admin.api.ApiResult;
import hsp.admin.app.literature.po.UpCountPO;
import hsp.admin.app.literature.service.IUpCountService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "UpCountController", description = "点赞表")
@RestController
@RequestMapping("literature/up/count")
public class UpCountController {

    private final IUpCountService service;

    @Autowired
    public UpCountController(
        IUpCountService service
    ){
        this.service = service;
    }

    @Operation(summary = "点赞")
    @PostMapping()
    public ApiResult<?> postOrPutUpCount(@RequestBody UpCountPO po){
        service.upCount(po);
        return ApiResult.success();
    }

}
